]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
cleanup: Don't use Array/Object constructors
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 19 Aug 2019 19:18:54 +0000 (21:18 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 15 Sep 2019 14:02:45 +0000 (16:02 +0200)
The corresponding literals are more concise and cleaner.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731

js/ui/altTab.js
js/ui/keyboard.js

index 98ca5b3862c90991cacfdf14b8a4a232fb6d6317..46f4ed912cc00cbb40373e9f0425097ba0a7ab62 100644 (file)
@@ -877,9 +877,9 @@ class ThumbnailList extends SwitcherPopup.SwitcherList {
     _init(windows) {
         super._init(false);
 
-        this._labels = new Array();
-        this._thumbnailBins = new Array();
-        this._clones = new Array();
+        this._labels = [];
+        this._thumbnailBins = [];
+        this._clones = [];
         this._windows = windows;
 
         for (let i = 0; i < windows.length; i++) {
@@ -940,7 +940,7 @@ class ThumbnailList extends SwitcherPopup.SwitcherList {
         }
 
         // Make sure we only do this once
-        this._thumbnailBins = new Array();
+        this._thumbnailBins = [];
     }
 
     _removeThumbnail(source, clone) {
index 68071506f429566b7135ea7a5efd6e4cd81644bd..183f82138427c928a1abe0fbed5e6c0beed55f19 100644 (file)
@@ -104,9 +104,10 @@ class KeyContainer extends St.Widget {
         this._currentRow++;
         this._currentCol = 0;
 
-        let row = new Object();
-        row.keys = [];
-        row.width = 0;
+        let row = {
+            keys: [],
+            width: 0,
+        };
         this._rows.push(row);
     }